<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/wesite/view/common/base.jsp"%>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>修改用户名</title>
    <%@ include file="/wesite/view/common/common.jsp"%>
    <style type="text/css">
        html,body{background:#fff;}
    </style>
</head>
<body>
<div class="modify-name aui-clearfix">
    <input type="text" value="${user.nickname}" placeholder="请输入昵称" name="nickname">
    <span id="xianzhi"></span>
    <div class="clear-btn aui-iconfont aui-icon-close">
    </div>
</div>
<button class="aui-btn aui-btn-block btn-info" onclick="saveinfo()" type="button">保存
</button>
</body>

</html>
<script>
    function saveinfo(){
        if($("[name='nickname']").val()==""){
            $("#xianzhi").text("请输入您的昵称");
            return;
        }else if(($("[name='nickname']").val()).length > 13){
            $("#xianzhi").text("昵称不等超过12位字符");
            return;
        }
        $w.httpRequest({
            url:"${ctx}/we/user/weeditsave",
            data:{"nickname":$("[name='nickname']").val(),"type":"nick"},
            ok:function(ret){
                window.location.href="${ctx}/we/user/wehome";
            }
        })
    }
</script>

